#if defined(TSINGMA_MX)

#include "ctc_error.h"
#include "ctc_port.h"
#include "ctc_ftm.h"
#include "ctc_field.h"
#include "ctc_scl.h"
#include "ctc_parser.h"
#include "ctc_packet.h"
#include "sys_usw_mchip.h"
#include "sys_tmm_mac.h"
#include "sys_tmm_datapath.h"
#include "sys_tmm_dot1ae.h"

extern int32 sys_tmm_capability_init(uint8 lchip);
extern int32 sys_tmm_interrupt_set_sup_op(uint8 lchip, uint8 grp_id, uint8 act_idx);
extern int32 sys_tsingma_hash_set_config(uint8 lchip, void* p_hash_cfg);
extern int32 sys_tsingma_hash_get_config(uint8 lchip, void* p_hash_cfg);
extern int32 sys_tsingma_hash_set_offset(uint8 lchip, void* p_hash_offset);
extern int32 sys_tsingma_hash_get_offset(uint8 lchip, void* p_hash_offset);
extern int32 sys_tsingma_hash_set_hash_control(uint8 lchip, void* p_hash_ctl);
extern int32 sys_tsingma_hash_get_hash_control(uint8 lchip, void* p_hash_ctl);
extern int32 sys_tsingma_hash_set_packet_disable(uint8 lchip, uint8 sel_id, uint8 packet_type, uint8 disable);
extern int32
sys_tsingma_parser_set_global_cfg(uint8 lchip, ctc_parser_global_cfg_t* p_global_cfg);
extern int32
sys_tsingma_parser_get_global_cfg(uint8 lchip, ctc_parser_global_cfg_t* p_global_cfg);

extern int32
sys_tsingma_parser_set_hash_field(uint8 lchip, void* p_hash_ctl, uint8 hash_usage);
extern int32
sys_tsingma_parser_get_hash_field(uint8 lchip, void* p_hash_ctl, uint8 hash_usage);
extern int32
sys_tsingma_nalpm_show_sram_usage(uint8 lchip);

extern int32
sys_tsingma_parser_hash_init(uint8 lchip);
extern int32
sys_tsingma_mac_link_up_event(uint8 lchip, uint16 lport);
extern int32
sys_tsingma_mac_link_down_event(uint8 lchip, uint16 lport);

extern int32
sys_tsingma_mac_set_capability(uint8 lchip, uint16 lport, ctc_port_capability_type_t type, uint32 value);

extern int32
sys_tmm_diag_get_pkt_trace(uint8 lchip, void* p_value, uint8 position);
extern int32
sys_tmm_diag_get_drop_info(uint8 lchip, void* p_value);
extern int32
sys_tmm_diag_set_dbg_pkt(uint8 lchip, void* p_value);
extern int32
sys_tmm_diag_set_dbg_session(uint8 lchip, void* p_value);
extern int32
sys_tsingma_diag_get_lb_hash(uint8 lchip, ctc_field_key_t* p_field_list, uint32 field_cnt, ctc_diag_lb_hash_t* p_rslt);
extern char*
sys_tmm_get_discard_type_desc(uint16 discard_type);
extern int32
sys_tmm_diag_get_pos(uint16 discard, uint8* pos);
extern int32
sys_tmm_map_drop_reason_ctc_to_sys(uint16 drop_reason, uint32* discard_type_bmp);
extern int32
sys_tmm_diag_get_drop_reason(uint8 lchip,uint32* reason);

extern int32
sys_tmm_scl_build_hash_key_svlan_dscp_port(uint8 lchip, ctc_field_key_t* pKey, void* pe, uint8 is_add);
extern int32
sys_tmm_scl_build_field_action_userid_vlan_edit(uint8 lchip, void* ds, void* pe, ctc_scl_field_action_t* pAction, uint8 is_add);
extern int32
sys_tmm_scl_build_field_action_userid(uint8 lchip, ctc_scl_field_action_t* pAction, void* pe, uint8 is_add);
extern int32
sys_tmm_scl_get_field_action_userid(uint8 lchip, ctc_scl_field_action_t* p_action, void* pe);
extern int32
sys_tmm_scl_update_action(uint8 lchip, void* data, void* change_nh_param);
extern int32
sys_tmm_scl_get_userid_default_action(uint8 lchip, void* p_default_action);

extern int32
sys_tmm_scl_move_dsuserid_to_temp(uint8 lchip, void* ds, uint8 userid_bmp);
extern int32
_sys_tmm_flow_stats_type_init(uint8 lchip);
extern int32
_sys_tmm_flow_stats_ram_init(uint8 lchip);
extern int32
sys_tmm_flow_stats_show_status(uint8 lchip);
extern int32
sys_tmm_flow_stats_ds2count(uint8 lchip, uint32 tbl_id, void* p_ds, ctc_stats_basic_t* p_count);
extern int32
sys_tmm_map_drop_reason_sys_to_ctc(uint16 discard_type, uint16 * p_drop_reason);
extern int32
sys_tmm_wb_app_id_init(uint8 lchip, void* p_app_id_info);
extern int32
sys_tmm_get_drop_resson_info(uint16 discard_type, uint8* p_dir, uint8* p_clear_on_read);
extern int32
sys_tmm_interrupt_get_intrvec_offset(uint8 lchip, uint32 intr_type, uint32 * p_offset);
extern int32
sys_tmm_interrupt_get_sup_info(uint8 lchip, uint32 intr_type, uint32 *p_sup_table_id, uint16 *p_bit_offset, uint32 *p_func_table_id);
extern int32
sys_tmm_interrupt_db_init(uint8 lchip);
extern int32
sys_tmm_scl_add_compress_ether_type(uint8 lchip, uint16 new_ether_type, uint16 old_ether_type,uint8* o_cether_type, uint8* o_cether_type_index);
extern int32
sys_tmm_scl_remove_compress_ether_type(uint8 lchip, uint8 ether_type_index);
extern int32
sys_tmm_acl_wb_sync(uint8 lchip, uint32 app_id, void * p_wb_data, void * p_user_data);
extern int32
sys_tmm_acl_wb_restore(uint8 lchip, void * p_wb_query);
extern int32
sys_tsingma_nalpm_wb_prefix_restore(uint8 lchip);
extern int32
sys_tsingma_nalpm_wb_prefix_sync(uint8 lchip, uint32 app_id, void * p_wb_data);
extern int32
sys_tmm_packet_txinfo_to_rawhdr(uint8 lchip, ctc_pkt_tx_t* p_pkt_tx);
extern int32
sys_tmm_packet_rawhdr_to_rxinfo(uint8 lchip, uint32* p_raw_hdr_net, ctc_pkt_rx_t* p_pkt_rx);
extern int32
sys_tmm_packet_encap_array(uint8 lchip, ctc_pkt_tx_t** p_pkt_tx_array, uint32 count);

extern void
sys_tmm_acl_show_kset(uint8 lchip, ctc_acl_flex_key_t * acl_flex_key);

extern int32 sys_tmm_l2_decode_dsmac(uint8 lchip, void* psys, uint32 ad_index, void* p_ds_mac);
extern int32 sys_tmm_l2_encode_key(uint8 lchip, void* p_ds_key, uint32* hw_mac, uint32 fid, uint32 ad_index);
extern int32 sys_tmm_l2_encode_dsmac(uint8 lchip, void* p_dsmac, void* p_sys);

extern int32 sys_tmm_l2_map_dma_to_entry(uint8 lchip, void* pa,uint8* p_data,int32 real_size);
extern int32 sys_tmm_acl_add_compress_ether_type(uint8 lchip, uint8 is_global, uint8 dir, uint16 new_ether_type, uint16 old_ether_type,uint8* o_cether_type, uint8* o_cether_type_index);
extern int32 sys_tmm_acl_add_egs_action_field(uint8 lchip, ctc_acl_field_action_t* action_field, void* pe_info, uint8 is_add);

extern int32 sys_tmm_acl_add_presel_fields(uint8 lchip, uint16 presel_id, uint8 fields_cnt, ctc_field_key_t *fields);
extern int32 sys_tmm_acl_add_udf_entry(uint8 lchip,  ctc_acl_classify_udf_t* p_udf_entry);
extern int32 sys_tmm_acl_alloc_tcam_entry(uint8 lchip, void* pg_info, void* pe_info);
extern int32 sys_tmm_acl_build_key_field(uint8 lchip, ctc_field_key_t* pKey, void* pe_info,uint8 is_add);
extern int32 sys_tmm_acl_compress_link_block(uint8 lchip, void *pb, void* fk);
extern int32 sys_tmm_acl_create_presel(uint8 lchip, ctc_acl_presel_t* acl_presel);
extern void sys_tmm_acl_deinit(uint8 lchip);
extern int32 sys_tmm_acl_destroy_presel(uint8 lchip, uint16 presel_id);
extern int32 sys_tmm_acl_expand_link_block(uint8 lchip, void* pb, void* fk, uint8 part_num);
extern int32 sys_tmm_acl_free_tcam_entry(uint8 lchip, void* pg_info, void* pe_info);
extern int32 sys_tmm_acl_get_egs_action_field(uint8 lchip, ctc_acl_field_action_t* action_field, void* pe_info);
extern int32 sys_tmm_acl_get_flex_key_fields(uint8 lchip, ctc_acl_flex_key_t* acl_flex_key);
extern int32 sys_tmm_acl_get_key_field(uint8 lchip, void* pe_info, ctc_field_key_t* pKey, uint32* key_width);
extern uint8 sys_tmm_acl_get_league_update_flag(uint8 lchip, uint8 dir, uint8 is_port, uint8 is_vlan, uint8 is_l3if);
extern int32 sys_tmm_acl_init(uint8 lchip);
extern int32 sys_tmm_acl_remove_compress_ether_type(uint8 lchip, uint8 is_global, uint8 dir, uint16 ether_type);
extern int32 sys_tmm_acl_remove_presel_fields(uint8 lchip, uint16 presel_id, uint8 fields_cnt, ctc_field_key_t *fields);
extern int32 sys_tmm_acl_reorder_entry(uint8 lchip, ctc_acl_reorder_t* reorder);
extern int32 sys_tmm_acl_set_flex_key_fields(uint8 lchip, ctc_acl_flex_key_t* acl_flex_key);
extern int32 sys_tmm_acl_set_league_global_config(uint8 lchip, void* config);
extern int32 sys_tmm_acl_set_league_mode_flex(uint8 lchip, ctc_acl_league_t* league, uint8* p_sub_blk_cnt, uint8* sub_blk, uint8* p_op_mode);
extern int32 sys_tmm_acl_show_flex_keygen(uint8 lchip, uint8 dir, uint8 key_type, uint32 eid, uint32* data);
extern int32 sys_tmm_acl_show_key_field(uint8 lchip, void* pe, uint8 show_inner);
extern int32 sys_tmm_acl_replace_block(uint8 lchip, ctc_acl_replace_t* p_replace);
extern int32 sys_tmm_acl_enable_udf_ipfix(uint8 lchip, uint16 udf_hit_idx,uint8 enable);
extern int32 sys_tmm_aging_get_aging_ptr(uint8 lchip, uint8 domain_type, uint32 key_index, uint32* aging_ptr);
extern int32 sys_tmm_aging_get_aging_status(uint8 lchip, uint8 domain_type, uint32 key_index, uint8* hit);
extern int32 sys_tmm_aging_get_aging_timer(uint8 lchip, uint8 domain_type, uint32 key_index, uint8* p_timer);
extern int32 sys_tmm_aging_get_key_index(uint8 lchip, uint32 aging_ptr, uint8* domain_type, uint32* key_index);
extern int32 sys_tmm_aging_set_aging_status(uint8 lchip, uint8 domain_type, uint32 key_index, uint8 timer, uint8 status);
extern int32 sys_tmm_aging_set_register(uint8 lchip);
extern int32 sys_tmm_aging_init(uint8 lchip);
extern int32 sys_tmm_dot1ae_add_sc_to_asic(uint8 lchip, void* p_sys_chan);
extern int32 sys_tmm_dot1ae_add_sa_to_asic(uint8 lchip, void* sec_chan, uint8 sa_idx, uint32 update_flag);
extern int32 sys_tmm_dot1ae_build_sc_index(uint8 lchip, void* sys_chan);
extern int32 sys_tmm_dot1ae_free_sc_index(uint8 lchip, void* sys_chan);
extern int32 sys_tmm_dot1ae_reset_sec_chan_cfg(uint8 lchip,     void* sys_chan);
extern int32 sys_tmm_dot1ae_en_sec_chan(uint8 lchip, void* bind_sc);
extern int32 sys_tmm_dot1ae_get_en_sec_chan(uint8 lchip, void* bind_sc);
extern int32 sys_tmm_dot1ae_update_sec_chan(uint8 lchip, void* sys_chan, void* sc);
extern int32 sys_tmm_dot1ae_unbind_sec_chan(uint8 lchip, void* bind_sc);
extern int32 sys_tmm_dot1ae_set_glb_cfg(uint8 lchip, void* glb_cfg);
extern int32 sys_tmm_dot1ae_get_glb_cfg(uint8 lchip, void* glb_cfg);
extern int32 sys_tmm_dot1ae_get_stats(uint8 lchip, uint32  chan_id, void* stats);
extern int32 sys_tmm_dot1ae_sync_dma_stats(uint8 lchip, void* p_data);
extern int32 sys_tmm_dot1ae_register_init(uint8 lchip);
extern int32 sys_tmm_dot1ae_chan_wb_restore(uint8 lchip, void* p_chan);
extern int32 sys_tmm_ipfix_decode_key_ad(uint8 lchip, void* p_data, uint8 is_ad, void* p_key);
extern int32 sys_tmm_ipfix_encode_ad(uint8 lchip, void* key);
extern int32 sys_tmm_ipfix_get_flow_cfg(uint8 lchip, void* p_flow_cfg);
extern int32 sys_tmm_ipfix_get_global_cfg(uint8 lchip, void* cfg);
extern int32 sys_tmm_ipfix_get_property(uint8 lchip, void* cfg);
extern int32 sys_tmm_ipfix_init_register(uint8 lchip, void* p_global_cfg);
extern int32 sys_tmm_ipfix_set_flow_cfg(uint8 lchip, void* p_flow_cfg);
extern int32 sys_tmm_ipfix_set_global_cfg(uint8 lchip, void* cfg);
extern int32 sys_tmm_ipfix_set_property(uint8 lchip, void* cfg);
extern int32 sys_tmm_ipfix_sync_data(uint8 lchip, void* p_dma_info);
extern int32 sys_tmm_ipfix_traverse_dma(uint8 lchip, void* fn, void* p_data, uint8 is_remove);
extern int32 sys_tmm_ipfix_cb_init(uint8 lchip);
extern int32 sys_tmm_l3if_db_init(uint8 lchip, uint8 deinit);
extern int32 sys_tmm_l3if_set_igs_if_rmac(uint8 lchip, uint16 l3if_id, ctc_l3if_router_mac_t router_mac);
extern int32 sys_tmm_l3if_set_system_router_mac(uint8 lchip, mac_addr_t mac_addr);
extern int32 sys_tmm_l3if_wb_rtmac_restore(uint8 lchip);
extern int32 sys_tmm_l3if_add_router_mac_entry(uint8 lchip, uint32 entry_id, ctc_l3if_rmac_entry_t* rmac_entry);
extern int32 sys_tmm_l3if_remove_router_mac_entry(uint8 lchip, uint32 entry_id);
extern int32 sys_tmm_l3if_get_router_mac_entry(uint8 lchip, uint32 entry_id, ctc_l3if_rmac_entry_t* rmac_entry);
extern int32 sys_tmm_l3if_show_router_mac_entry(uint8 lchip, uint32 entry_id);
extern int32 sys_tmm_l3if_wb_rtmac_sync(uint8 lchip,uint32 app_id);
extern int32 sys_tmm_l3if_dump_db(uint8 lchip, sal_file_t p_f,ctc_global_dump_db_t* p_dump_param);
extern int32 sys_tmm_l3if_get_igs_if_rmac(uint8 lchip, uint16 l3if_id, ctc_l3if_router_mac_t* router_mac);
extern int32 sys_tmm_linkagg_add_nonuc_ports(uint8 lchip, void* p_lag_group, uint32 gport, uint8 nonuc_block_en);
extern int32 sys_tmm_linkagg_channel_update_nonuc_ports(uint8 lchip, bool is_add_port, uint16 chan_id, uint32* mem_bmp);
extern int32 sys_tmm_linkagg_destroy(uint8 lchip, void* p_lag_group);
extern int32 sys_tmm_linkagg_dlb_get_config(uint8 lchip, void* p_cfg);
extern int32 sys_tmm_linkagg_dlb_init(uint8 lchip);
extern int32 sys_tmm_linkagg_dlb_set_config(uint8 lchip, void* p_cfg);
extern int32 sys_tmm_linkagg_remove_nonuc_ports(uint8 lchip, void* p_lag_group, uint32 gport, uint8 nonuc_block_en);
extern int32 sys_tmm_linkagg_set_lsh(uint8 lchip, void* p_lag_group, uint32 fail_port, void* p_ports);
extern int32 sys_tmm_linkagg_bind_mirror(uint8 lchip, uint16 tid, uint8 is_add);
extern int32 sys_tmm_linkagg_replace_nonuc_ports(uint8 lchip, void* p_lag_group);
extern int32 sys_tmm_mirror_set_dst_to_linkagg(uint8 lchip, void* met_fifo_excp, uint32* member_list, uint16 member_cnt, uint8 is_set);
extern int32 sys_tmm_mirror_update_linkagg_member(uint8 lchip, uint16 tid, uint32* member_list, uint16 member_cnt, uint8 is_set);
extern int32 sys_tmm_monitor_clear_path_latency_watermark(uint8 lchip, void* p_mon_watermark, uint16 channel_id);
extern int32 sys_tmm_monitor_deinit(uint8 lchip);
extern int32 sys_tmm_monitor_get_global_config(uint8 lchip, void* p_mon_cfg);
extern int32 sys_tmm_monitor_get_path_latency(uint8 lchip, void* p_cfg, uint8 *enable);
extern int32 sys_tmm_monitor_get_path_latency_watermark(uint8 lchip, void* p_mon_watermark, uint16 channel_id);
extern int32 sys_tmm_monitor_init(uint8 lchip);
extern int32 sys_tmm_monitor_set_global_config(uint8 lchip, void* p_mon_cfg);
extern int32 sys_tmm_monitor_set_path_latency(uint8 lchip, void* p_cfg, uint8 enable);
extern int32 sys_tmm_monitor_show_path(uint8 lchip);
extern int32 sys_tmm_nh_add_fp(uint8 lchip, void* p_fp_edit, uint8 is_internal);
extern int32 sys_tmm_nh_fp_init(uint8 lchip);
extern int32 sys_tmm_nh_get_fp_db(uint8 lchip, uint32 fp_id, void** pp_nh_fp_db);
extern int32 sys_tmm_nh_get_fp_info(uint8 lchip, uint32 fp_id, void* p_fp_info);
extern int32 sys_tmm_nh_remove_fp(uint8 lchip, uint32 fp_id);
extern int32 sys_tmm_nh_update_fp(uint8 lchip, void* p_fp_edit);
extern int32 sys_tmm_npm_get_lite_stats(uint8 lchip, uint32 session_id, void* p_lite_stats);
extern int32 sys_tmm_npm_process_isr(uint8 gchip, void* p_data);
extern int32 sys_tmm_npm_set_lite_config(uint8 lchip, void* p_cfg);
extern int32 sys_tmm_npm_sync_dma_stats(uint8 lchip, void* p_data);
extern int32 sys_tmm_port_set_xpipe_en(uint8 lchip, uint32 gport, uint32 value);
extern int32 sys_tmm_port_set_xpipe_mode(uint8 lchip, uint32 gport, uint32 value);
extern int32 sys_tmm_port_flow_ctl_init(uint8 lchip);
extern int32 sys_tmm_port_get_flow_ctl_en(uint8 lchip, void* p_fc_prop);
extern int32 sys_tmm_port_set_flow_ctl_en(uint8 lchip, void* p_fc_prop, uint8 is_recover);
extern int32 sys_tmm_port_set_pause_speed(uint8 lchip, uint32 mac_id, void* p_data);
extern int32 sys_tmm_qos_get_policer_param(uint8 lchip, void* p_param, void* p_policer);
extern int32 sys_tmm_qos_policer_add_to_asic(uint8 lchip, void* p_policer, void* p_profX,
                                                   void* p_profY, void*  p_action_profile);
extern int32 sys_tmm_qos_policer_alloc_offset(uint8 lchip, void* p_policer);
extern int32 sys_tmm_qos_policer_copp_add_to_asic(uint8 lchip, void* p_policer, void* p_prof);
extern int32 sys_tmm_qos_policer_copp_init(uint8 lchip);
extern int32 sys_tmm_qos_policer_deinit_opf(uint8 lchip);
extern int32 sys_tmm_qos_policer_free_offset(uint8 lchip, void* p_policer);
extern int32 sys_tmm_qos_policer_free_statsptr(uint8 lchip, void* p_policer, uint32* p_stats_ptr);
extern int32 sys_tmm_qos_policer_init_opf(uint8 lchip);
extern int32 sys_tmm_qos_policer_init_reg(uint8 lchip);
extern int32 sys_tmm_qos_policer_remove_from_asic(uint8 lchip, void* p_policer);
extern int32 sys_tmm_qos_policer_restore_offset(uint8 lchip, void* p_policer);
extern int32 sys_tmm_qos_policer_spool_deinit(uint8 lchip);
extern int32 sys_tmm_qos_policer_spool_init(uint8 lchip);
extern int32 sys_tmm_qos_queue_init(uint8 lchip);
extern int32 sys_tmm_qos_fcdl_recover_drop_pkt(uint8 lchip, void* p_sys_queue_node_param,  uint16 queue_id, uint8  chan_id, uint8 enable, uint8 pfc_en);
extern int32 sys_tmm_qos_sch_init(uint8 lchip);
extern int32 sys_tmm_qos_shape_init(uint8 lchip);
extern int32 sys_tmm_queue_del_hash_key(uint8 lchip, uint32 key_index);
extern int32 sys_tmm_queue_flush(uint8 lchip,uint16 chan_id,uint16 group_id,uint8 flag, uint16 queue_id);
extern int32 sys_tmm_queue_get_channel_by_group_id(uint8 lchip, uint32 group_id, uint16 *channel);
extern int32 sys_tmm_queue_get_channel_by_queue_id(uint8 lchip, uint16 queue_id, uint16 *channel);
extern int32 sys_tmm_queue_get_queue_base(uint8 lchip, uint8 channel, uint16 queue_offset, uint16* queue_base);
extern int32 sys_tmm_queue_set_port_drop_en(uint8 lchip, uint16 chan_id, bool enable);
extern int32 sys_tmm_queue_write_hash_key(uint8 lchip, uint32 service, uint16 dest_port_or_chan, uint16 group_id, uint8 type, uint8 is_lsp, uint32* p_key_index);
extern int32 sys_tmm_queue_drop_read_asic(uint8 lchip, uint8 wred_mode, void* p_queue_node, void* p_sys_profile, uint8* hw_valid);
extern int32 sys_tmm_resrc_fc_get_profile(uint8 lchip, uint16 chan_id, void *p_resrc_fc);
extern int32 sys_tmm_resrc_set_que_drop(uint8 lchip, uint8 is_dynamic, uint8 enable, void* que_drop_array, void* p_queue);
extern int32 sys_tmm_sch_create_sched_group(uint8 lchip, void* p_sched_grp, uint32 chan);
extern int32 sys_tmm_sch_destroy_sched_group(uint8 lchip, void* p_sched_grp);
extern int32 sys_tmm_sch_dump_sched_group_child_list(uint8 lchip, uint32 group_id);
extern int32 sys_tmm_sch_get_group_sched(uint8 lchip, void* p_sched_grp);
extern int32 sys_tmm_sch_get_queue_sched(uint8 lchip, uint16 queue_id, uint8 queue_offset, uint8* exceed_class, uint16* exceed_weight);
extern int32 sys_tmm_sch_set_group_sched(uint8 lchip, void* p_sched_grp);
extern int32 sys_tmm_sch_set_hsched(uint8 lchip, uint32 gport, uint16 group_id_l4, uint8 enable, uint8 type);
extern int32 sys_tmm_sch_set_queue_sched(uint8 lchip, uint16 queue_id, uint8 type, uint8 queue_offset, uint8 exceed_class, uint16 exceed_weight);
extern int32 sys_tmm_sch_update_fc_group(uint8 lchip, uint16 chan_id, uint16 ets_group_id, uint8 is_ets, uint8 enable);
extern int32 sys_tmm_shape_add_chan_shp_to_asic(uint8 lchip, uint16 channel, uint32 pir, uint32 pbs,
                                                           uint8 is_pps, uint8 enable);
extern int32 sys_tmm_shape_add_group_node_shape(uint8 lchip, uint32 group_id, uint8 group_node, uint8 is_pps,
                                                           uint32 pir, uint32 pbs, uint8 is_cir, uint8 enable);
extern int32 sys_tmm_shape_add_group_shape(uint8 lchip, uint32 group_id, uint8 is_pps,
                                                    uint32 pir, uint32 pbs, uint8 enable);
extern int32 sys_tmm_shape_add_que_shp_to_asic(uint8 lchip, uint16 queue_id, uint8 queue_offset,
                                                        void* p_shape, uint8 is_pps);
extern int32 sys_tmm_shape_get_grp_node_shape_profile(uint8 lchip, uint32 group_id, uint8 group_node, uint8 is_cir, uint32* rate, uint32* thrd, uint8* pps_en, uint8* p_shp_en);
extern int32 sys_tmm_shape_get_grp_shape_profile(uint8 lchip, uint32 group_id, uint32* rate, uint32* thrd, uint8* pps_en, uint8* p_shp_en);
extern int32 sys_tmm_shape_get_port_shape_profile(uint8 lchip, uint16 channel, uint32* rate, uint32* thrd, uint8* pps_en, uint8* p_shp_en);
extern int32 sys_tmm_shape_get_que_shape_profile(uint8 lchip, uint16 queue_id, uint16 queue_offset, void* p_shape);
extern int32 sys_tmm_qos_set_reason_shp_base_pkt_en(uint8 lchip, uint8 enable);
extern int32 sys_usw_qos_api_cb_register_before_at(uint8 lchip, void** api_cb);
extern int32 sys_tmm_qos_fcdl_recover_drop_pkt(uint8 lchip, void* p_sys_queue_node_param,  uint16 queue_id, uint8  chan_id, uint8 enable, uint8 pfc_en);
extern int32 sys_tmm_storm_ctl_add_hw(uint8 lchip, uint32 stmctl_offset,
                void* p_cfg, void* p_profile_param,uint8 is_add);
extern int32 sys_tmm_storm_ctl_get_profile_from_hw(uint8 lchip, uint32 stmctl_offset,
                        void* p_cfg, void* p_profile_param);
extern int32 sys_tsingma_datapath_init(uint8 lchip, ctc_datapath_global_cfg_t* p_datapath_cfg);
extern int32 sys_tmm_datapath_init(uint8 lchip, ctc_datapath_global_cfg_t* p_datapath_cfg);
extern int32 sys_tsingma_ipuc_alloc_tcam_key_index(uint8 lchip, void *p_data);
extern int32 sys_tsingma_ipuc_free_tcam_key_index(uint8 lchip, void *p_data);
extern int32 sys_tsingma_ipuc_tcam_deinit(uint8 lchip, uint8 route_mode);
extern int32 sys_tsingma_ipuc_tcam_get_blockid(uint8 lchip, void *p_data_v, uint8 *p_block_id);
extern int32 sys_tsingma_ipuc_tcam_init(uint8 lchip, uint8 route_mode, void* ofb_cb_fn);
extern int32 sys_tsingma_ipuc_tcam_move(uint8 lchip, uint32 new_index, uint32 old_index, void *pdata);
extern int32 sys_tsingma_ipuc_tcam_move_cb(uint8 lchip, uint32 new_index, uint32 old_index, void *pdata);
extern int32 sys_tsingma_ipuc_tcam_show_key(uint8 lchip, void *p_data);
extern int32 sys_tsingma_ipuc_tcam_show_status(uint8 lchip, sal_file_t p_f);
extern int32 sys_tsingma_ipuc_tcam_write_ad(uint8 lchip, void *p_data_v);
extern int32 sys_tsingma_ipuc_tcam_write_key(uint8 lchip, void *p_data_v);
extern int32 sys_tmm_ipuc_build_ipda_nexthop(uint8 lchip, void* p_v_sys_param, void* temp_dsnh_info, void* p_v_dsipda);
extern int32 sys_tmm_ipuc_write_ipda(uint8 lchip, void* p_v_sys_param, uint8 by_user, void* p_v_nhinfo);
extern int32 sys_tsingma_mac_get_capability(uint8 lchip, uint16 lport, ctc_port_capability_type_t type, void* p_value);
extern int32 sys_tsingma_mac_get_link_up(uint8 lchip, uint16 lport, uint32* p_is_up, uint32 is_port);
extern int32 sys_tsingma_mac_get_property(uint8 lchip, uint16 lport, ctc_port_property_t port_prop, uint32* p_value);
extern int32 sys_tsingma_mac_init(uint8 lchip);
extern int32 sys_tmm_mac_get_capability(uint8 lchip, uint16 lport, ctc_port_capability_type_t type, void* p_value);
extern int32 sys_tmm_mac_get_link_up(uint8 lchip, uint16 lport, uint32* p_is_up, uint32 is_port);
extern int32 sys_tmm_mac_get_property(uint8 lchip, uint16 lport, ctc_port_property_t port_prop, uint32* p_value);
extern int32 sys_tmm_cpumac_get_lport_info_by_inner_idx(uint8 lchip, uint8 inner_idx, uint16* lport, uint8 *is_network);
extern int32 sys_tmm_mac_init(uint8 lchip);
extern int32 sys_tsingma_mac_self_checking(uint8 lchip, uint16 lport);
extern int32 sys_tsingma_mac_set_interface_mode(uint8 lchip, uint16 lport, ctc_port_if_mode_t* if_mode);
extern int32 sys_tsingma_mac_set_property(uint8 lchip, uint16 lport, ctc_port_property_t port_prop, uint32 value);
extern int32 sys_tmm_mac_set_interface_mode(uint8 lchip, uint16 lport, ctc_port_if_mode_t* if_mode);
extern int32 sys_tmm_mac_set_property(uint8 lchip, uint16 lport, ctc_port_property_t port_prop, uint32 value);
extern int32 sys_tmm_mcu_show_debug_info(uint8 lchip, uint8 _in_mcu_id);
extern int32 sys_tsingma_nalpm_wb_set_tcam_index(uint8 lchip);
extern int32 sys_tsingma_nalpm_wb_set_ad_info(uint8 lchip);
extern int32 sys_tsingma_nalpm_add(uint8 lchip, void* p_ipuc_param_v, uint32 ad_index, void* data);
extern int32 sys_tsingma_nalpm_deinit(uint8 lchip);
extern int32 sys_tsingma_nalpm_del(uint8 lchip, void* p_ipuc_param_v);
extern int32 sys_tsingma_nalpm_check_route(uint8 lchip, void *p_info, void* cb);
extern int32 sys_tsingma_nalpm_dump_db(uint8 lchip, sal_file_t p_f, ctc_global_dump_db_t* p_dump_param);
extern int32 sys_tsingma_nalpm_get_fragment_auto_enable(uint8 lchip, uint8* enable);
extern int32 sys_tsingma_nalpm_get_fragment_status(uint8 lchip, uint8 ip_ver, uint8* status);
extern int32 sys_tsingma_nalpm_init(uint8 lchip, ctc_ipuc_global_cfg_t* p_ipuc_global_cfg, uint8 para2);
extern int32 sys_tsingma_nalpm_set_fragment_status(uint8 lchip, uint8 ip_ver, uint8 status);
extern int32 sys_tsingma_nalpm_show_route_info(uint8 lchip, void* p_ipuc_param);
extern int32 sys_tsingma_nalpm_show_status(uint8 lchip);
extern int32 sys_tsingma_nalpm_update(uint8 lchip, void* p_ipuc_param, uint32 ad_index);
extern int32 sys_tsingma_nalpm_wb_get_info(uint8 lchip, void* p_ipuc_param, void* p_alpm_info);
extern int32 sys_tsingma_peri_get_gpio_input(uint8 lchip, uint8 gpio_id, uint8* in_value);
extern int32 sys_tsingma_peri_get_mac_led_en(uint8 lchip, bool* enable);
extern int32 sys_tsingma_peri_set_mac_led_clock(uint8 lchip, uint16 freq);
extern int32 sys_tsingma_peri_get_mac_led_clock(uint8 lchip, uint16 * freq);
extern int32 sys_tsingma_peri_get_mdio_clock(uint8 lchip, ctc_chip_mdio_type_t type, uint16* freq);
extern int32 sys_tsingma_peri_get_phy_scan_para(uint8 lchip, ctc_chip_phy_scan_ctrl_t* p_scan_para);
extern int32 sys_tsingma_peri_init(uint8 lchip);
extern int32 sys_tsingma_peri_mdio_init(uint8 lchip);
extern int32 sys_tsingma_peri_phy_link_change_isr(uint8 lchip, uint32 intr, void* p_data);
extern int32 sys_tsingma_peri_get_chip_sensor(uint8 lchip, ctc_chip_sensor_type_t type, uint32 * p_value);
extern int32 sys_tsingma_peri_set_phy_sample_offset(uint8 lchip, ctc_chip_mdio_para_t* p_mdio_para);
extern int32 sys_tsingma_peri_get_phy_sample_offset(uint8 lchip, ctc_chip_mdio_para_t* p_mdio_para);
extern int32 sys_tsingma_peri_set_phy_sample_edge(uint8 lchip, ctc_chip_mdio_para_t* p_mdio_para);
extern int32 sys_tsingma_peri_get_phy_sample_edge(uint8 lchip, ctc_chip_mdio_para_t* p_mdio_para);
extern int32 sys_tsingma_peri_read_phy_reg(uint8 lchip, ctc_chip_mdio_type_t type, ctc_chip_mdio_para_t* p_para);
extern int32 sys_tsingma_peri_set_gpio_mode(uint8 lchip, uint8 gpio_id, ctc_chip_gpio_mode_t mode);
extern int32 sys_tsingma_peri_set_gpio_output(uint8 lchip, uint8 gpio_id, uint8 out_para);
extern int32 sys_tsingma_peri_set_mac_led_en(uint8 lchip, bool enable);
extern int32 sys_tsingma_peri_set_mac_led_mapping(uint8 lchip, ctc_chip_mac_led_mapping_t* p_led_map);
extern int32 sys_tsingma_peri_set_mac_led_mode(uint8 lchip, ctc_chip_led_para_t* p_led_para, ctc_chip_mac_led_type_t led_type, uint8 inner);
extern int32 sys_tsingma_peri_set_mdio_clock(uint8 lchip, ctc_chip_mdio_type_t type, uint16 freq);
extern int32 sys_tsingma_peri_set_phy_scan_cfg(uint8 lchip);
extern int32 sys_tsingma_peri_set_phy_scan_para(uint8 lchip, ctc_chip_phy_scan_ctrl_t* p_scan_para);
extern int32 sys_tsingma_peri_write_phy_reg(uint8 lchip, ctc_chip_mdio_type_t type, ctc_chip_mdio_para_t* p_para);
extern int32 sys_tmm_peri_get_chip_sensor(uint8 lchip, void* sensor);
extern int32 sys_tmm_serdes_get_link_training_status(uint8 lchip, uint16 serdes_id, uint16* p_value);
extern int32 sys_tmm_serdes_get_property(uint8 lchip, ctc_chip_property_t chip_prop, void* p_value);
extern int32 sys_tmm_serdes_set_link_training_en(uint8 lchip, uint16 serdes_id, uint8 enable);
extern int32 sys_tmm_serdes_set_mode(uint8 lchip, ctc_chip_serdes_info_t* p_serdes_info);
extern int32 sys_tmm_serdes_set_property(uint8 lchip, ctc_chip_property_t chip_prop, void* p_value);
extern void* sys_tmm_acl_get_flex_key(uint8 lchip, uint8 dir, uint8 key_type);
extern int32 sys_tmm_nh_get_edit_param(uint8 lchip, void* p_nh_db, void* p_para);
extern int32 sys_tmm_nh_ecmp_clear_dlb_flow(uint8 lchip, void* p_nhdb_param);
extern int32 sys_tmm_datapath_show_xpipe(uint8 lchip);
extern int32 sys_tmm_datapath_get_extport_start_id(uint8 lchip, uint16* p_lport_start);
extern int32 sys_tmm_oam_get_mep_info_for_event(uint8 lchip, void* p_mep_info);
extern int32 sys_tmm_mac_link_up_event(uint8 lchip, uint16 lport);
extern int32 sys_tmm_mac_link_down_event(uint8 lchip, uint16 lport);
extern int32 sys_tmm_mac_set_capability(uint8 lchip, uint16 lport, ctc_port_capability_type_t type, uint32 value);
extern int32
sys_tmm_mac_set_direction_property(uint8 lchip, uint16 lport, ctc_port_direction_property_t port_prop, ctc_direction_t dir, uint32 value);
extern int32
sys_tmm_mac_get_direction_property(uint8 lchip, uint16 lport, ctc_port_direction_property_t port_prop, ctc_direction_t dir, uint32* p_value);
extern int32
sys_tmm_mac_get_link_info(uint8 lchip, uint16 lport, void* p_value);
extern int32
sys_tmm_mac_set_link_info(uint8 lchip, uint16 lport, void* p_value);

/* FlexE */
extern int32 sys_tmm_flexe_set_en(uint8 lchip, uint16 serdes_id, uint8 enable);
extern int32 sys_tmm_flexe_get_en(uint8 lchip, uint16 serdes_id, uint8 *enable);
extern int32 sys_tmm_flexe_create_group(uint8 lchip, uint32 group_id, ctc_flexe_grp_t* p_group);
extern int32 sys_tmm_flexe_destroy_group(uint8 lchip, uint32 group_id);
extern int32 sys_tmm_flexe_get_group(uint8 lchip, uint32 group_id, ctc_flexe_grp_t* p_group);
extern int32 sys_tmm_flexe_set_group_property(uint8 lchip, uint32 group_id, ctc_flexe_grp_prop_t group_prop, void* p_value);
extern int32 sys_tmm_flexe_get_group_property(uint8 lchip, uint32 group_id, ctc_flexe_grp_prop_t group_prop, void* p_value);
extern int32 sys_tmm_flexe_add_client(uint8 lchip, uint32  client_id, ctc_flexe_client_t* p_client);
extern int32 sys_tmm_flexe_remove_client(uint8 lchip, uint32  client_id);
extern int32 sys_tmm_flexe_get_client(uint8 lchip, uint32 client_id, ctc_flexe_client_t* p_client);
extern int32 sys_tmm_flexe_set_client_property(uint8 lchip, uint32  client_id, uint32 client_prop, void* p_value);
extern int32 sys_tmm_flexe_get_client_property(uint8 lchip, uint32 client_id, uint32 client_prop, void* p_value);
extern int32 sys_tmm_flexe_get_client_link_up(uint8 lchip, uint32  client_id, uint8* p_is_up);
extern int32 sys_tmm_flexe_set_client_cross(uint8 lchip, ctc_flexe_cross_t* p_cross);
extern int32 sys_tmm_flexe_get_client_cross(uint8 lchip, ctc_flexe_cross_t* p_cross);
extern int32 sys_tmm_flexe_set_phy_property(uint8 lchip, uint16 serdes_id, ctc_flexe_phy_prop_t phy_prop, void* p_value);
extern int32 sys_tmm_flexe_get_phy_property(uint8 lchip, uint16 serdes_id, ctc_flexe_phy_prop_t phy_prop, void* p_value);
extern int32 sys_tmm_flexe_get_phy_inst_id(uint8 lchip, uint8 dp_id, uint8 asic_inst_id, uint8* p_serdes_id, uint32* p_instance_id);
extern int32 sys_tmm_flexe_get_phy_oh_sync(uint8 lchip, uint8 serdes_id, uint32* p_enable);
extern int32 sys_tmm_flexe_get_dp_asic_id(uint8 lchip, uint8 serdes_id, uint32 instance_id, uint8* p_dp_id, uint8 p_asic_inst_id[]);
extern int32 sys_tmm_flexe_init(uint8 lchip, void* p_cfg);
extern int32 sys_tmm_flexe_deinit(uint8 lchip);
extern int32 sys_tmm_flexe_monitor(uint8 lchip);
extern int32 sys_tmm_flexe_monitor_cr_timer(uint8 lchip);
extern int32 sys_tmm_flexe_monitor_alarm(uint8 lchip);

extern int32 sys_tmm_flexe_event_isr(uint8 lchip, uint32 intr, void* p_data);
extern int32 sys_tmm_flexe_update_misc(uint8 lchip);
extern int32 sys_tmm_flexe_debug_show_ins_sch(uint8 lchip, uint8 flexe_shim_id, uint8 inst_id, uint8 dir);
extern int32 sys_tmm_flexe_debug_show_inst_status(uint8 lchip, uint8 flexe_shim_id);
extern int32 sys_tmm_flexe_debug_show_inst_ohram(uint8 lchip, uint8 flexe_shim_id, uint8 inst_id, uint8 dir);
extern int32 sys_tmm_flexe_debug_show_client(uint8 lchip, uint32 client_id);
extern int32 sys_tmm_flexe_debug_show_group(uint8 lchip, uint32 group_id);
extern int32 sys_tmm_flexe_debug_show_status(uint8 lchip);
extern int32 sys_tmm_flexe_debug_show_alarm(uint8 lchip);
extern int32 sys_tmm_flexe_wb_restore_sch(uint8 lchip, void* group_node);

/* SRV6 */
extern int32 sys_usw_srv6_set_gsid_default_action(uint8 lchip, uint16 lport, uint8 deinit);
extern int32 sys_tmm_interrpt_dispatch_func(uint8 lchip, uint32* p_status);
extern int32 sys_tmm_interrut_dispatch_flexe(uint8 lchip, uint32 sub_intr);
extern int32 sys_tmm_interrut_isr_sup_normal(uint8 lchip, uint32 intr, void* p_data);
extern int32 sys_tmm_interrupt_init_reg(uint8 lchip);
extern int32
sys_tsingma_port_set_property(uint8 lchip, uint32 gport, ctc_port_property_t port_prop, uint32 value);
extern int32
sys_tsingma_port_get_property(uint8 lchip, uint32 gport, ctc_port_property_t port_prop, uint32* p_value);
extern int32
sys_tsingma_port_init(uint8 lchip);

/* dmps_db */
extern int32 sys_usw_dmps_get_port_property(uint8 lchip, sys_dmps_port_info_t* port_info, uint8 dmps_port_prop, void *p_value);
extern uint16 sys_usw_dmps_get_lport_with_chan(uint8 lchip, uint8 dir_bmp, uint16 chan_id);
extern uint16 sys_usw_dmps_get_lport_with_subchan(uint8 lchip, uint8 sub_chan_id);
extern uint16 sys_usw_dmps_get_lport_with_subchan_db(uint8 lchip, uint8 dir_bmp, uint8 core, uint8 pp, uint8 dp, uint8 sub_chan_id);
extern uint16 sys_usw_dmps_get_lport_with_mac(uint8 lchip, uint16 mac_id);
extern int32 sys_dmps_get_sub_chan_by_chan(uint8 lchip, uint8 dir_bmp, uint16 chan, uint16* sub_chan, uint8* pp_id, uint8* dp_id);
extern int32
sys_tmm_mac_self_checking(uint8 lchip, uint16 lport);
extern int32
sys_tmm_register_get_glb_acl_table(uint8 lchip, uint8 dir, void* p_glb_acl_lkup);
extern int32
sys_tmm_linkagg_loop_chan_lag_en(uint8 lchip, uint32 enable);

extern int32
sys_tmm_dma_tcam_scan_reg_init(uint8 lchip, void* p_chan_info, void* p_sys_desc_pad, void* p_sys_desc_info);
extern int32
sys_tmm_dma_tcam_scan_func(uint8 lchip, uint16 chan);
extern int32
sys_tmm_dma_set_tcam_scan_mode(uint8 lchip, uint8 mode, uint32 timer);
extern int32
sys_tsingma_dma_sync_pkt_rx_stats(uint8 lchip);
extern int32
sys_tsingma_dma_sync_pkt_tx_stats(uint8 lchip);
extern int32
sys_tmm_dma_pkt_tx(uint8 lchip, ctc_pkt_tx_t* p_pkt_tx);
extern int32
sys_tmm_dma_pkt_rx(uint8 lchip, uint8 chan_id, void* p_thread_info);
extern int32
sys_tmm_dma_set_pkt_timer(uint8 lchip, uint32 timer, uint8 enable);
extern int32
sys_tmm_dma_set_session_pkt(uint8 lchip, uint16 session_id, ctc_pkt_tx_t* p_pkt);
extern int32
sys_tmm_dma_function_pause(uint8 lchip, uint8 chan_id, uint8 en);
extern int32
sys_tmm_dma_sync_hash_dump(uint8 lchip, void* p_pa, uint16* p_entry_num, void* p_data);
extern int32
sys_tmm_dma_set_packet_timer_cfg(uint8 lchip, uint16 max_session, uint16 interval, uint16 pkt_len, uint8 is_destroy);
extern int32
sys_tmm_dma_info_func(uint8 lchip, uint8 chan);
extern int32
sys_tmm_dma_stats_func(uint8 lchip, uint8 chan);
extern int32
sys_tmm_dma_pkt_tx_array(uint8 lchip, ctc_pkt_tx_t** p_pkt_tx_array, uint32 count);
extern int32
sys_tmm_dma_read_table(uint8 lchip, void* tbl_cfg);
extern int32
sys_tmm_dma_write_table(uint8 lchip, void* tbl_cfg);
extern int32
sys_tmm_dma_reset(uint8 lchip);

extern int32
_sys_tmm_check_datapath_credit_clear(uint8 lchip, uint32 mac_id, uint32 chan_id);
extern int32
_sys_tmm_datapath_get_internal_chan_start(uint8 lchip, uint8 dp_id, uint16* p_chan_id);
extern int32
sys_tmm_mac_get_sfd_en(uint8 lchip, uint16 lport, uint32 *enable);
extern int32
sys_tmm_mac_set_sfd_en(uint8 lchip, uint16 lport, uint32 enable);
extern int32
_sys_tmm_mac_get_cl37_en(uint8 lchip, uint16 lport, uint32* p_en);
extern int32
_sys_tmm_mac_get_cl37_mode(uint8 lchip, uint16 lport, uint32* p_mode);
extern int32
sys_tmm_mac_set_rx_pmac_sfd_en(uint8 lchip, uint16 lport, uint32 value);
extern int32
sys_tmm_mac_set_tx_pmac_sfd_en(uint8 lchip, uint16 lport, uint32 value);
extern int32
_sys_tmm_mac_port_set_cl73_ability(uint8 lchip, uint16 lport, void* p_ability);

sys_usw_mchip_1ae_t sys_tmm_mchip_1ae =
{
#if (FEATURE_MODE == 0)
    sys_tmm_dot1ae_add_sc_to_asic,
    sys_tmm_dot1ae_add_sa_to_asic,
    sys_tmm_dot1ae_build_sc_index,
    sys_tmm_dot1ae_free_sc_index,
    sys_tmm_dot1ae_reset_sec_chan_cfg,
    sys_tmm_dot1ae_get_en_sec_chan,
    sys_tmm_dot1ae_en_sec_chan,
    sys_tmm_dot1ae_update_sec_chan,
    sys_tmm_dot1ae_unbind_sec_chan,
    sys_tmm_dot1ae_set_glb_cfg,
    sys_tmm_dot1ae_get_glb_cfg,
    sys_tmm_dot1ae_get_stats,
    sys_tmm_dot1ae_sync_dma_stats,
    sys_tmm_dot1ae_register_init,
    NULL,/* AT, add entry */
    NULL,/* AT, remove entry  */
    NULL,/* AT, show entry */
    NULL, /* AT, chk pp id */
    NULL, /* AT, set_hash_field_sel */
    NULL, /* AT, get_hash_field_sel */
    NULL, /* AT, set_chan_ctl */
    sys_tmm_dot1ae_chan_wb_restore,
    NULL,   /* entry_hash_init */
    NULL    /* entry_hash_deinit */
 #endif
};

sys_usw_mchip_lag_t sys_tmm_mchip_lag =
{
   sys_tmm_linkagg_destroy,
   sys_tmm_linkagg_add_nonuc_ports,
   sys_tmm_linkagg_remove_nonuc_ports,
   sys_tmm_linkagg_dlb_init,
   sys_tmm_linkagg_dlb_set_config,
   sys_tmm_linkagg_dlb_get_config,
   sys_tmm_linkagg_set_lsh,
   sys_tmm_linkagg_channel_update_nonuc_ports,
   sys_tmm_linkagg_bind_mirror,
   NULL, // update_mirror_dest,
   sys_tmm_linkagg_replace_nonuc_ports,
   NULL,     // update_nonuc_ports_by_pp
   sys_tmm_linkagg_loop_chan_lag_en
};


sys_usw_mchip_dmps_t sys_tmm_mchip_dmps =
{
    .mac_set_property                   = sys_tmm_mac_set_property,
    .mac_get_property                   = sys_tmm_mac_get_property,
    .mac_set_interface_mode             = sys_tmm_mac_set_interface_mode,
    .mac_get_link_up                    = sys_tmm_mac_get_link_up,
    .mac_get_capability                 = sys_tmm_mac_get_capability,
    .mac_set_capability                 = sys_tmm_mac_set_capability,
    .serdes_set_property                = sys_tmm_serdes_set_property,
    .serdes_get_property                = sys_tmm_serdes_get_property,
    .serdes_set_mode                    = sys_tmm_serdes_set_mode,
    .serdes_set_link_training_en        = sys_tmm_serdes_set_link_training_en,
    .serdes_get_link_training_status    = sys_tmm_serdes_get_link_training_status,
    .datapath_init                      = sys_tmm_datapath_init,
    .mac_init                           = sys_tmm_mac_init,
    .mcu_show_debug_info                = sys_tmm_mcu_show_debug_info,
    .mac_self_checking                  = sys_tmm_mac_self_checking,
    .mac_link_up_event                  = sys_tmm_mac_link_up_event,
    .mac_link_down_event                = sys_tmm_mac_link_down_event,
    .datapath_show_xpipe                = sys_tmm_datapath_show_xpipe,
    .datapath_get_extport_start_id      = sys_tmm_datapath_get_extport_start_id,
    .cpumac_get_lport_info_by_inner_idx = sys_tmm_cpumac_get_lport_info_by_inner_idx,
    .mac_set_direction_property         = sys_tmm_mac_set_direction_property,
    .mac_get_direction_property         = sys_tmm_mac_get_direction_property,
    .mac_set_link_info                  = sys_tmm_mac_set_link_info,
    .mac_get_link_info                  = sys_tmm_mac_get_link_info,
    .check_datapath_credit_clear        = _sys_tmm_check_datapath_credit_clear,
    .get_internal_chan_start            = _sys_tmm_datapath_get_internal_chan_start,
    .mac_get_sfd_en                     = sys_tmm_mac_get_sfd_en,
    .mac_set_sfd_en                     = sys_tmm_mac_set_sfd_en,
    .mac_get_cl37_en                    = _sys_tmm_mac_get_cl37_en,
    .mac_get_cl37_mode                  = _sys_tmm_mac_get_cl37_mode,
    .mac_set_rx_pmac_sfd_en             = sys_tmm_mac_set_rx_pmac_sfd_en,
    .mac_set_tx_pmac_sfd_en             = sys_tmm_mac_set_tx_pmac_sfd_en,
    .mac_set_port_cl73_ability          = _sys_tmm_mac_port_set_cl73_ability,
};

sys_usw_mchip_flexe_t sys_tmm_mchip_flexe =
{
#if (FEATURE_MODE == 0)
    /*flexe dmps API */
    sys_tmm_flexe_set_en,
    sys_tmm_flexe_get_en,
    sys_tmm_flexe_create_group,  /**/
    sys_tmm_flexe_destroy_group,  /**/
    sys_tmm_flexe_get_group,  /**/
    sys_tmm_flexe_set_group_property,  /**/
    sys_tmm_flexe_get_group_property,  /**/
    sys_tmm_flexe_add_client,  /**/
    sys_tmm_flexe_remove_client,  /**/
    sys_tmm_flexe_get_client,  /**/
    sys_tmm_flexe_set_client_property,  /**/
    sys_tmm_flexe_get_client_property,  /**/
    sys_tmm_flexe_get_client_link_up,  /**/
    sys_tmm_flexe_set_client_cross,  /**/
    sys_tmm_flexe_get_client_cross,  /**/
    sys_tmm_flexe_set_phy_property,  /**/
    sys_tmm_flexe_get_phy_property,  /**/
    sys_tmm_flexe_get_phy_inst_id,  /**/
    sys_tmm_flexe_get_phy_oh_sync,  /**/
    sys_tmm_flexe_get_dp_asic_id,  /**/
    sys_tmm_flexe_init,  /**/
    sys_tmm_flexe_deinit,   /**/
    sys_tmm_flexe_monitor,   /**/
    sys_tmm_flexe_monitor_cr_timer,   /**/
    sys_tmm_flexe_event_isr, /**/
    sys_tmm_flexe_update_misc,  /**/
    sys_tmm_flexe_debug_show_ins_sch,  /**/
    sys_tmm_flexe_debug_show_inst_status,  /**/
    sys_tmm_flexe_debug_show_inst_ohram,  /**/
    sys_tmm_flexe_debug_show_client,  /**/
    sys_tmm_flexe_debug_show_group,  /**/
    sys_tmm_flexe_debug_show_status,  /**/
    sys_tmm_flexe_debug_show_alarm,  /**/
    sys_tmm_flexe_wb_restore_sch,
    sys_tmm_flexe_monitor_alarm,   /**/
    /*flexe dmps API */
#endif
};

sys_usw_mchip_ipuc_t sys_tmm_mchip_ipuc =
{
#if ((FEATURE_MODE == 2) || (FEATURE_MODE == 0))
    sys_tsingma_ipuc_tcam_init,
    sys_tsingma_ipuc_tcam_deinit,
    sys_tsingma_ipuc_tcam_get_blockid,
    sys_tsingma_ipuc_tcam_write_key,
    sys_tsingma_ipuc_tcam_write_ad,
    sys_tsingma_ipuc_tcam_move,
    sys_tsingma_ipuc_tcam_show_key,
    sys_tsingma_ipuc_tcam_show_status,
    sys_tsingma_nalpm_show_sram_usage,
    sys_tsingma_nalpm_init,
    sys_tsingma_nalpm_deinit,
    sys_tsingma_nalpm_add,
    sys_tsingma_nalpm_del,
    sys_tsingma_nalpm_update,
    NULL,/*alpm_arrange_fragment*/
    sys_tsingma_nalpm_show_route_info,
    sys_tsingma_nalpm_show_status,/*alpm_show_status*/
    NULL,/*alpm_mapping_wb_master*/
    sys_tsingma_nalpm_wb_get_info,
    sys_tsingma_nalpm_dump_db,
    NULL,
    sys_tsingma_nalpm_set_fragment_status,
    sys_tsingma_nalpm_get_fragment_status,
    sys_tsingma_nalpm_get_fragment_auto_enable,
    NULL,
    sys_tsingma_nalpm_check_route,
    NULL,
    sys_tsingma_nalpm_wb_prefix_restore,
    sys_tsingma_nalpm_wb_prefix_sync,
    sys_tsingma_ipuc_alloc_tcam_key_index,
    sys_tsingma_ipuc_free_tcam_key_index,
    sys_tsingma_ipuc_tcam_move_cb,
    sys_tmm_ipuc_build_ipda_nexthop,
    sys_tmm_ipuc_write_ipda,
    sys_tsingma_nalpm_wb_set_tcam_index,
    sys_tsingma_nalpm_wb_set_ad_info,
    /* nalpm */
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL
#endif
};

sys_usw_mchip_acl_t sys_tmm_mchip_acl =
{
    sys_tmm_acl_init,
    sys_tmm_acl_deinit,
    sys_tmm_acl_set_flex_key_fields,
    sys_tmm_acl_get_flex_key_fields,
    sys_tmm_acl_create_presel,
    sys_tmm_acl_destroy_presel,
    sys_tmm_acl_add_presel_fields,
    sys_tmm_acl_remove_presel_fields,
    sys_tmm_acl_alloc_tcam_entry,
    sys_tmm_acl_free_tcam_entry,
    sys_tmm_acl_build_key_field,
    sys_tmm_acl_get_key_field,
    sys_tmm_acl_show_key_field,
    NULL,
    sys_tmm_acl_add_egs_action_field,
    sys_tmm_acl_get_egs_action_field,
    sys_tmm_acl_set_league_mode_flex,
    sys_tmm_acl_expand_link_block,
    sys_tmm_acl_compress_link_block,
    sys_tmm_acl_get_league_update_flag,
    sys_tmm_acl_add_compress_ether_type,
    sys_tmm_acl_remove_compress_ether_type,
    sys_tmm_acl_add_udf_entry,
    sys_tmm_acl_show_flex_keygen,
    sys_tmm_acl_get_flex_key,
    sys_tmm_acl_wb_sync,
    sys_tmm_acl_wb_restore,
    sys_tmm_acl_set_league_global_config,
    sys_tmm_acl_reorder_entry,
    sys_tmm_acl_show_kset,
    NULL,
    NULL,
    sys_tmm_acl_replace_block,
    sys_tmm_acl_enable_udf_ipfix
};

sys_usw_mchip_scl_t sys_tmm_mchip_scl =
{
    sys_tmm_scl_build_hash_key_svlan_dscp_port,
    sys_tmm_scl_build_field_action_userid_vlan_edit,
    sys_tmm_scl_build_field_action_userid,
    sys_tmm_scl_build_field_action_userid,
    sys_tmm_scl_get_field_action_userid,
    sys_tmm_scl_get_field_action_userid,
    sys_tmm_scl_update_action,
    sys_tmm_scl_get_userid_default_action,
    sys_tmm_scl_add_compress_ether_type,
    sys_tmm_scl_remove_compress_ether_type,
    sys_tmm_scl_move_dsuserid_to_temp,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL
};

sys_usw_mchip_l3if_t sys_tmm_mchip_l3if =
{
    sys_tmm_l3if_set_igs_if_rmac,
    sys_tmm_l3if_set_system_router_mac,
    sys_tmm_l3if_db_init,
    sys_tmm_l3if_wb_rtmac_restore,
    sys_tmm_l3if_add_router_mac_entry,
    sys_tmm_l3if_remove_router_mac_entry,
    sys_tmm_l3if_get_router_mac_entry,
    sys_tmm_l3if_show_router_mac_entry,
    sys_tmm_l3if_wb_rtmac_sync,
    sys_tmm_l3if_dump_db,
    sys_tmm_l3if_get_igs_if_rmac
};

sys_usw_mchip_ipfix_t sys_tmm_mchip_ipfix =
{
#if (FEATURE_MODE == 0)
    sys_tmm_ipfix_decode_key_ad,
    sys_tmm_ipfix_encode_ad,
    sys_tmm_ipfix_set_property,
    sys_tmm_ipfix_get_property,
    sys_tmm_ipfix_set_global_cfg,
    sys_tmm_ipfix_get_global_cfg,
    sys_tmm_ipfix_set_flow_cfg,
    sys_tmm_ipfix_get_flow_cfg,
    sys_tmm_ipfix_init_register,
    sys_tmm_ipfix_sync_data,
    sys_tmm_ipfix_traverse_dma,
    sys_tmm_ipfix_cb_init,
    NULL,/*ipfix_set_flex_key*/
    NULL,/*ipfix_get_flex_key*/
    NULL,/*ipfix_get_flex_key_sets*/
    NULL/*ipfix_encode_xkey_hash*/
#endif
};

sys_usw_mchip_aging_t sys_tmm_mchip_ag =
{
    sys_tmm_aging_set_register,
    sys_tmm_aging_get_key_index,
    sys_tmm_aging_get_aging_ptr,
    sys_tmm_aging_set_aging_status,
    sys_tmm_aging_get_aging_status,
    sys_tmm_aging_get_aging_timer,
    sys_tmm_aging_init
};

sys_usw_mchip_nh_t sys_tmm_mchip_nh =
{
    sys_tmm_nh_fp_init,
    sys_tmm_nh_add_fp,
    sys_tmm_nh_remove_fp,
    sys_tmm_nh_update_fp,
    sys_tmm_nh_get_fp_db,
    sys_tmm_nh_get_fp_info,
    NULL,
    sys_tmm_nh_get_edit_param,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    sys_tmm_nh_ecmp_clear_dlb_flow
};

sys_usw_mchip_misc_t sys_tmm_mchip_misc =
{
    sys_tmm_capability_init,
    NULL,
    sys_tmm_map_drop_reason_sys_to_ctc,
    NULL,
    sys_tmm_register_get_glb_acl_table,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    sys_tmm_get_drop_resson_info
};

sys_usw_mchip_paser_t sys_tmm_mchip_psr =
{
    sys_tsingma_parser_set_hash_field,
    sys_tsingma_parser_get_hash_field,
    sys_tsingma_parser_hash_init,
    sys_tsingma_parser_set_global_cfg,
    sys_tsingma_parser_get_global_cfg
};


sys_usw_mchip_hash_t sys_tmm_mchip_hash =
{
    sys_tsingma_hash_set_config,
    sys_tsingma_hash_get_config,
    sys_tsingma_hash_set_offset,
    sys_tsingma_hash_get_offset,
    sys_tsingma_hash_set_hash_control,
    sys_tsingma_hash_get_hash_control,
    NULL,   /* AT hash_init */
    NULL,   /* AT hash_set_selector_ext */
    NULL,   /* AT hash_get_selector_ext */
    NULL,   /* AT hash_set_selector_remap */
    NULL,   /* AT hash_get_selector_remap */
    NULL,   /* AT set_mask_profile_en */
    NULL,   /* AT set_udf_hash_en */
    NULL,   /* AT get_udf_hash_en */
    NULL,   /* AT set_field */
    NULL    /* AT get_field */
};

sys_usw_mchip_qos_t sys_tmm_mchip_qos =
{
    sys_tmm_qos_policer_alloc_offset,
    sys_tmm_qos_policer_free_offset,
    sys_tmm_qos_policer_add_to_asic,
    sys_tmm_qos_policer_remove_from_asic,
    sys_tmm_qos_policer_copp_add_to_asic,
    sys_tmm_qos_policer_deinit_opf,
    sys_tmm_qos_policer_init_opf,
    sys_tmm_qos_policer_spool_init,
    sys_tmm_qos_policer_spool_deinit,
    sys_tmm_qos_policer_init_reg,
    sys_tmm_qos_policer_copp_init,
    sys_tmm_qos_policer_restore_offset,
    sys_tmm_qos_get_policer_param,
    sys_tmm_qos_policer_free_statsptr,
    sys_tmm_shape_add_que_shp_to_asic,
    sys_tmm_shape_add_group_shape,
    sys_tmm_shape_add_group_node_shape,
    sys_tmm_shape_add_chan_shp_to_asic,
    sys_tmm_shape_get_que_shape_profile,
    sys_tmm_shape_get_grp_shape_profile,
    sys_tmm_shape_get_grp_node_shape_profile,
    sys_tmm_shape_get_port_shape_profile,
    sys_tmm_qos_set_reason_shp_base_pkt_en,
    sys_tmm_queue_write_hash_key,
    sys_tmm_queue_del_hash_key,
    sys_tmm_queue_get_channel_by_group_id,
    sys_tmm_queue_get_channel_by_queue_id,
    sys_tmm_queue_get_queue_base,
    sys_tmm_queue_flush,
    sys_tmm_queue_set_port_drop_en,
    sys_tmm_queue_drop_read_asic,
    sys_tmm_sch_set_hsched,
    sys_tmm_sch_set_queue_sched,
    sys_tmm_sch_set_group_sched,
    sys_tmm_sch_get_queue_sched,
    sys_tmm_sch_get_group_sched,
    sys_tmm_sch_create_sched_group,
    sys_tmm_sch_destroy_sched_group,
    sys_tmm_sch_dump_sched_group_child_list,
    sys_tmm_sch_update_fc_group,
    sys_tmm_resrc_set_que_drop,
    sys_tmm_resrc_fc_get_profile,
    sys_tmm_qos_shape_init,
    sys_tmm_qos_sch_init,
    sys_tmm_qos_queue_init,
	sys_tmm_qos_fcdl_recover_drop_pkt,
    sys_usw_qos_api_cb_register_before_at,
    NULL, /*qos_fcdl_recover*/
    NULL  /*qos_fcdl_detect_mac*/
};

sys_usw_mchip_security_t sys_tmm_mchip_security =
{
    sys_tmm_storm_ctl_get_profile_from_hw,
    sys_tmm_storm_ctl_add_hw
};

sys_usw_mchip_diag_t sys_tmm_mchip_diag =
{
#if (FEATURE_MODE == 0)
    sys_tmm_diag_get_pkt_trace,
    sys_tmm_diag_get_drop_info,
    sys_tmm_diag_set_dbg_pkt,
    sys_tmm_diag_set_dbg_session,
    NULL,
    NULL,
    sys_tsingma_diag_get_lb_hash,
    sys_tmm_get_discard_type_desc,
    sys_tmm_diag_get_pos,
    sys_tmm_map_drop_reason_ctc_to_sys,
    sys_tmm_diag_get_drop_reason
#endif
};

sys_usw_mchip_mon_t sys_tmm_mchip_monitor =
{
#if (FEATURE_MODE == 0)
    sys_tmm_monitor_set_path_latency,
    sys_tmm_monitor_get_path_latency,
    sys_tmm_monitor_get_path_latency_watermark,
    sys_tmm_monitor_clear_path_latency_watermark,
    sys_tmm_monitor_set_global_config,
    sys_tmm_monitor_get_global_config,
    NULL,
    sys_tmm_monitor_init,
    sys_tmm_monitor_deinit,
    sys_tmm_monitor_show_path,
    NULL,
    NULL,
    NULL
#endif
};

sys_usw_mchip_flowstats_t sys_tmm_mchip_flow_stats =
{
    _sys_tmm_flow_stats_type_init,
    _sys_tmm_flow_stats_ram_init,
    sys_tmm_flow_stats_show_status,
    sys_tmm_flow_stats_ds2count,
    NULL
};

sys_usw_mchip_macstats_t sys_tmm_mchip_mac_stats =
{
    NULL,
    NULL,
    NULL
};

sys_usw_mchip_npm_t sys_tmm_mchip_npm=
{
#if (FEATURE_MODE == 0)
    sys_tmm_npm_set_lite_config,
    sys_tmm_npm_get_lite_stats,
    sys_tmm_npm_sync_dma_stats,
    sys_tmm_npm_process_isr
#endif
};

sys_usw_mchip_mirror_t sys_tmm_mchip_mirror =
{
#if (FEATURE_MODE == 0)
    sys_tmm_mirror_set_dst_to_linkagg,
    sys_tmm_mirror_update_linkagg_member
#endif
};

sys_usw_mchip_interrupt_t sys_tmm_mchip_intr =
{
    sys_tmm_interrupt_get_sup_info,
    sys_tmm_interrupt_get_intrvec_offset,
    sys_tmm_interrupt_db_init,
    sys_tmm_interrpt_dispatch_func,
    sys_tmm_interrut_dispatch_flexe,
    sys_tmm_interrut_isr_sup_normal,
    sys_tmm_interrupt_init_reg,
    sys_tmm_interrupt_set_sup_op
};

sys_usw_mchip_port_t sys_tmm_mchip_port =
{
    sys_tmm_port_flow_ctl_init,
    sys_tmm_port_set_flow_ctl_en,
    sys_tmm_port_get_flow_ctl_en,
    sys_tmm_port_set_pause_speed,
    sys_tsingma_port_set_property,
    sys_tsingma_port_get_property,
    sys_tsingma_port_init,
    NULL,
    NULL,
    NULL,
    NULL,
    sys_tmm_port_set_xpipe_en,
    sys_tmm_port_set_xpipe_mode
};

sys_usw_mchip_packet_t sys_tmm_mchip_packet =
{
    sys_tmm_packet_txinfo_to_rawhdr,
    sys_tmm_packet_rawhdr_to_rxinfo,
    sys_tmm_packet_encap_array
};
sys_usw_mchip_oam_t sys_tmm_mchip_oam =
{
#if (FEATURE_MODE == 0)
    sys_tmm_oam_get_mep_info_for_event
#endif
};

sys_usw_mchip_xdata_t sys_tmm_mchip_xdata =
{
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL
};


sys_usw_mchip_srv6_t sys_tmm_mchip_srv6 =
{
#if (FEATURE_MODE == 0)
    sys_usw_srv6_set_gsid_default_action
#endif
};

sys_usw_mchip_aps_t sys_tmm_mchip_aps =
{
#if (FEATURE_MODE == 0)
    NULL, /* AT aps_set_hw */
    NULL, /* AT aps_get_hw */
    NULL  /* AT aps_set_protections */
#endif
};

sys_usw_mchip_peri_t sys_tmm_mchip_peri =
{
    sys_tsingma_peri_init,
    sys_tsingma_peri_mdio_init,
    sys_tsingma_peri_set_phy_scan_cfg,
    sys_tsingma_peri_set_phy_scan_para,
    sys_tsingma_peri_get_phy_scan_para,
    sys_tsingma_peri_read_phy_reg,
    sys_tsingma_peri_write_phy_reg,
    sys_tsingma_peri_set_mdio_clock,
    sys_tsingma_peri_get_mdio_clock,
    sys_tsingma_peri_set_mac_led_mode,
    sys_tsingma_peri_set_mac_led_mapping,
    sys_tsingma_peri_set_mac_led_en,
    sys_tsingma_peri_get_mac_led_en,
    sys_tsingma_peri_set_mac_led_clock,
    sys_tsingma_peri_get_mac_led_clock,
    sys_tsingma_peri_set_gpio_mode,
    sys_tsingma_peri_set_gpio_output,
    sys_tsingma_peri_get_gpio_input,
    sys_tsingma_peri_phy_link_change_isr,
    sys_tmm_peri_get_chip_sensor,
    NULL,/* set sensor monitor */
    NULL,/* get sensor monitor */
    sys_tsingma_peri_set_phy_sample_offset,
    sys_tsingma_peri_get_phy_sample_offset,
    sys_tsingma_peri_set_phy_sample_edge,
    sys_tsingma_peri_get_phy_sample_edge
};

sys_usw_mchip_ptp_t sys_tmm_mchip_ptp =
{

};

sys_usw_mchip_dmps_db_t sys_tmm_mchip_dmps_db =
{
    sys_usw_dmps_get_port_property,
    sys_usw_dmps_get_lport_with_chan,
    sys_usw_dmps_get_lport_with_subchan_db,
    sys_usw_dmps_get_lport_with_mac,
    sys_dmps_get_sub_chan_by_chan,
};

sys_usw_mchip_sync_ether_t sys_tmm_mchip_sync_ether =
{
    NULL, /* AT sync_ether_set_cfg */
    NULL  /* AT sync_ether_get_cfg */
};

sys_usw_mchip_dma_t sys_tmm_mchip_dma =
{
    sys_tmm_dma_tcam_scan_reg_init,
    sys_tmm_dma_tcam_scan_func,
    sys_tmm_dma_set_tcam_scan_mode,
    sys_tsingma_dma_sync_pkt_rx_stats,
    sys_tsingma_dma_sync_pkt_tx_stats,
    sys_tmm_dma_pkt_tx,
    sys_tmm_dma_pkt_rx,
    sys_tmm_dma_set_pkt_timer,
    sys_tmm_dma_set_session_pkt,
    sys_tmm_dma_function_pause,
    sys_tmm_dma_sync_hash_dump,
    sys_tmm_dma_set_packet_timer_cfg,
    NULL,/*AT, dma_init_reg_buffer_scan*/
    NULL,/* AT, dma_batch_operation */
    sys_tmm_dma_info_func,
    sys_tmm_dma_stats_func,
    sys_tmm_dma_pkt_tx_array,
    sys_tmm_dma_read_table,
    sys_tmm_dma_write_table,
    sys_tmm_dma_reset
};
    
sys_usw_mchip_serdes_t sys_tmm_mchip_serdes = {NULL};

#if defined E_UNIT && (FEATURE_MODE == 0)

extern int32
sys_tmm_eunit_set_cfg(uint8 lchip, uint8 cfg_type, void* p_cfg);
extern int32
sys_tmm_eunit_get_cfg(uint8 lchip, uint8 cfg_type, void* p_cfg);
extern int32
sys_tmm_eunit_isr_handler(uint8 lchip, uint32 intr, void* p_data);
extern int32
sys_tmm_eunit_reset(uint8 lchip, uint8 unit, ctc_eunit_install_t* p_eunit);
extern int32
sys_tmm_eunit_get_unit_id(uint8 lchip, uint8 cfg_type, uint8* unit);
extern int32
sys_tmm_eunit_get_mcpu_cfg_flag(uint8 lchip, uint32 flag, uint8 mcpu_num,uint8* val);
extern int32
sys_tmm_eunit_set_mcpu_cfg_flag(uint8 lchip, uint32 flag, uint8 mcpu_num,uint8 val);
extern int32
sys_tmm_eunit_mcpu_read_data(uint8 lchip,uint8 mcpu_num,uint32* p_data,uint32 lenth);
extern int32
sys_tmm_eunit_mcpu_write_data(uint8 lchip,uint8 mcpu_num,uint32* p_data,uint32 lenth);
extern int32
sys_tmm_eunit_load_image(uint8 lchip, uint8 unit, ctc_eunit_install_t* p_eunit);
extern int32
sys_tmm_eunit_show_status(uint8 lchip, uint8 level, void* p_params);
extern int32
sys_tmm_eunit_hw_lock(uint8 lchip, uint8 eunit_id, uint8 lock_id);
extern int32
sys_tmm_eunit_hw_unlock(uint8 lchip, uint8 eunit_id, uint8 lock_id);
extern int32
sys_tmm_eunit_mcpu_set_config(uint8 lchip, uint8 idx, uint32* value);
extern int32
sys_tmm_eunit_mcpu_get_config(uint8 lchip, uint8 idx, uint32* value);
extern int32
sys_tmm_eunit_show_dma_stats(uint8 lchip, uint8 eunit_id);
extern int32
sys_tmm_eunit_clear_dma_stats(uint8 lchip, uint8 eunit_id);
extern int32
sys_tmm_eunit_show_dma_status(uint8 lchip, uint8 eunit_id);
extern int32
sys_tmm_eunit_show_dma_desc(uint8 lchip,      uint8 eunit_id, uint8 chan_id, uint32 start_idx, uint32 end_idx);
extern int32
sys_tmm_eunit_show_debug_info(uint8 lchip, uint8 eunit_id);


sys_usw_mchip_eunit_t sys_tmm_mchip_eunit =
{
#if (FEATURE_MODE == 0)
    sys_tmm_eunit_set_cfg,
    sys_tmm_eunit_get_cfg,
    sys_tmm_eunit_isr_handler,
    sys_tmm_eunit_reset,
    sys_tmm_eunit_get_unit_id,
    sys_tmm_eunit_get_mcpu_cfg_flag,
    sys_tmm_eunit_set_mcpu_cfg_flag,
    sys_tmm_eunit_mcpu_read_data,
    sys_tmm_eunit_mcpu_write_data,
    sys_tmm_eunit_load_image,
    sys_tmm_eunit_show_status,
    NULL,/*init_deinit*/
    sys_tmm_eunit_hw_lock,/* hw_lock */
    sys_tmm_eunit_hw_unlock, /* hw_unlock */
    NULL, /* get_hw_lock */
    sys_tmm_eunit_show_debug_info, /* show_dbg_info*/
    NULL, /* read_data */
    sys_tmm_eunit_show_dma_stats,
    sys_tmm_eunit_clear_dma_stats,
    NULL, /* get_pclog*/
    NULL,
    sys_tmm_eunit_show_dma_status,
    sys_tmm_eunit_show_dma_desc,
    NULL, /* show_mem */
    NULL, /*  query_io_log*/
    sys_tmm_eunit_mcpu_set_config,
    sys_tmm_eunit_mcpu_get_config,
	NULL  /*set_run_status*/
#endif
};
#endif

sys_usw_mchip_fdb_t sys_tmm_mchip_fdb =
{
    sys_tmm_l2_decode_dsmac,
    sys_tmm_l2_encode_dsmac,
    sys_tmm_l2_encode_key
};

int32
sys_tmm_mchip_init(uint8 lchip)
{

    p_sys_mchip_master[lchip]->p_capability = (uint32*)mem_malloc(MEM_SYSTEM_MODULE, sizeof(uint32)*SYS_CAP_MAX);
    if (NULL == p_sys_mchip_master[lchip]->p_capability)
    {
        return CTC_E_NO_MEMORY;
    }
    sal_memset(p_sys_mchip_master[lchip]->p_capability, 0, sizeof(uint32)*SYS_CAP_MAX);

    p_sys_mchip_master[lchip]->p_mchip_api = (sys_usw_mchip_api_t *)mem_malloc(MEM_SYSTEM_MODULE, sizeof(sys_usw_mchip_api_t));
    if (NULL == p_sys_mchip_master[lchip]->p_mchip_api)
    {
        return CTC_E_NO_MEMORY;
    }
    sal_memset(p_sys_mchip_master[lchip]->p_mchip_api, 0, sizeof(sys_usw_mchip_api_t));
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_1ae = &sys_tmm_mchip_1ae;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_lag = &sys_tmm_mchip_lag;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_dmps = &sys_tmm_mchip_dmps;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_ipuc = &sys_tmm_mchip_ipuc;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_acl = &sys_tmm_mchip_acl;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_scl = &sys_tmm_mchip_scl;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_l3if = &sys_tmm_mchip_l3if;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_aging = &sys_tmm_mchip_ag;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_nh = &sys_tmm_mchip_nh;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_misc = &sys_tmm_mchip_misc;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_paser = &sys_tmm_mchip_psr;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_hash = &sys_tmm_mchip_hash;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_qos = &sys_tmm_mchip_qos;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_security = &sys_tmm_mchip_security;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_diag = &sys_tmm_mchip_diag;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_monitor = &sys_tmm_mchip_monitor;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_ipfix = &sys_tmm_mchip_ipfix;
    p_sys_mchip_master[lchip]->p_mchip_api->p_flow_stats = &sys_tmm_mchip_flow_stats;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mac_stats = &sys_tmm_mchip_mac_stats;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_npm= &sys_tmm_mchip_npm;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_mirror= &sys_tmm_mchip_mirror;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_intr = &sys_tmm_mchip_intr;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_port = &sys_tmm_mchip_port;
#if defined E_UNIT && (FEATURE_MODE == 0)
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_eunit = &sys_tmm_mchip_eunit;
#endif
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_packet = &sys_tmm_mchip_packet;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_xdata = &sys_tmm_mchip_xdata;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_oam = &sys_tmm_mchip_oam;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_aps = &sys_tmm_mchip_aps;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_flexe = &sys_tmm_mchip_flexe;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_srv6 = &sys_tmm_mchip_srv6;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_peri = &sys_tmm_mchip_peri;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_ptp = &sys_tmm_mchip_ptp;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_dmps_db = &sys_tmm_mchip_dmps_db;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_sync_ether = &sys_tmm_mchip_sync_ether;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_dma = &sys_tmm_mchip_dma;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_fdb = &sys_tmm_mchip_fdb;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_serdes = &sys_tmm_mchip_serdes;
    sal_memset(p_sys_mchip_master[lchip]->feature,0x01,CTC_FEATURE_MAX*sizeof(uint8));
    p_sys_mchip_master[lchip]->feature[CTC_FEATURE_WLAN] = 0;
    p_sys_mchip_master[lchip]->feature[CTC_FEATURE_APP_VLAN_PORT] = 0;
    p_sys_mchip_master[lchip]->feature[CTC_FEATURE_XDATA] = 0;
    if(DRV_CHIP_SUB_TYPE(lchip) == DRV_CHIP_SUB_TYPE_1 || \
            DRV_CHIP_SUB_TYPE(lchip) == DRV_CHIP_SUB_TYPE_2)
    {
        p_sys_mchip_master[lchip]->feature[CTC_FEATURE_FLEXE] = 0;
    }
    return CTC_E_NONE;
}

int32
sys_tmm_mchip_deinit(uint8 lchip)
{
    CTC_PTR_VALID_CHECK(p_sys_mchip_master[lchip]);

    if (p_sys_mchip_master[lchip]->p_capability)
    {
        mem_free(p_sys_mchip_master[lchip]->p_capability);
    }
    if (p_sys_mchip_master[lchip]->p_mchip_api)
    {
        mem_free(p_sys_mchip_master[lchip]->p_mchip_api);
    }
    return CTC_E_NONE;
}
#endif

